package ACWing.DataStructure.哈希表;
//841. 字符串哈希

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/12/30 13:10
 */
public class StringHash {
    static Long[]h=new Long[100010];
    static Long[]p=new Long[100010];
    static int base=131;
    public static long get(int l,int r){
        return h[r]-h[l-1]*p[r-l+1];
    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        sc.nextLine();
        String s=sc.next();
        char[] str = s.toCharArray();
        System.out.println(Arrays.toString(str));
        p[0]= Long.valueOf(1);
        h[0]= Long.valueOf(0);
        for (int i = 1; i <= n; i++) {
            h[i]=h[i-1]*base+str[i-1]-'a'+1;
            p[i]=p[i-1]*base;
        }

        while (m-->0){
            int l1=sc.nextInt();
            int r1=sc.nextInt();
            int l2=sc.nextInt();
            int r2=sc.nextInt();
            if(get(l1,r1)==get(l2,r2)){
                System.out.println("Yes");
            }else {
                System.out.println("No");
            }
        }
    }

}
